package com.example.shengyin.entity;


import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.sql.Timestamp;

@Data
@ApiModel("评论")
public class Comment {
    @ApiModelProperty("编号")
    private Long id;
    @ApiModelProperty("用户id")
    private Long userid;

    @NotNull(message = "新闻号不能为空")
    @Pattern(regexp = "^[1-9]\\d*$",message = "新闻号必须是正整数！")
    @ApiModelProperty("新闻号")
    private Long articleid;

    @ApiModelProperty("内容")
    private String content;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @ApiModelProperty("发布时间")
    private Timestamp addtime;
    @ApiModelProperty("ip")
    private String ip;

    @ApiModelProperty("用户名")
    private String uname;

    @ApiModelProperty("文章摘要")
    private String abstr;

}
